package com.androidx.p013lv.mine.model;

import android.content.Context;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.bean.UserAccount;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;
import com.androidx.p013lv.mine.bean.PayBean;
import com.androidx.p013lv.mine.bean.VipCenterBean;

/* renamed from: com.androidx.lv.mine.model.VipCenterModel */
public class VipCenterModel extends ViewModel {
    private MutableLiveData<BaseRes<UserAccount>> accountData;
    private MutableLiveData<BaseRes<PayBean>> payData;
    private MutableLiveData<UserAccount> userAccountMutableLiveData;
    private MutableLiveData<BaseRes<VipCenterBean>> vipCenterData;

    public MutableLiveData<BaseRes<UserAccount>> dataAccount() {
        if (this.accountData == null) {
            this.accountData = new MutableLiveData<>();
        }
        return this.accountData;
    }

    public MutableLiveData<UserAccount> dataUserAccount() {
        if (this.userAccountMutableLiveData == null) {
            this.userAccountMutableLiveData = new MutableLiveData<>();
        }
        return this.userAccountMutableLiveData;
    }

    public MutableLiveData<BaseRes<PayBean>> dataPay() {
        if (this.payData == null) {
            this.payData = new MutableLiveData<>();
        }
        return this.payData;
    }

    public MutableLiveData<BaseRes<VipCenterBean>> dataVipCenter() {
        if (this.vipCenterData == null) {
            this.vipCenterData = new MutableLiveData<>();
        }
        return this.vipCenterData;
    }

    public void getCardList(Context context) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().vipCardList(), new HttpCallback<BaseRes<VipCenterBean>>("vipCardList", context) {
            /* class com.androidx.p013lv.mine.model.VipCenterModel.C13701 */

            public void onLvSuccess(BaseRes<VipCenterBean> baseRes) {
                VipCenterModel.this.vipCenterData.setValue(baseRes);
            }
        });
    }

    public void rechargePay(String str, Context context) {
        HttpUtils.getInsatance().post(UrlManager.getInsatance().getPayUrl(), str, new HttpCallback<BaseRes<PayBean>>("payment", context) {
            /* class com.androidx.p013lv.mine.model.VipCenterModel.C13712 */

            public void onLvSuccess(BaseRes<PayBean> baseRes) {
                VipCenterModel.this.payData.setValue(baseRes);
            }
        });
    }

    public void changeUserAccount(UserAccount userAccount) {
        this.userAccountMutableLiveData.setValue(userAccount);
    }

    public void userAccList(Context context) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().userAccList(), new HttpCallback<BaseRes<UserAccount>>("userAccount", context) {
            /* class com.androidx.p013lv.mine.model.VipCenterModel.C13723 */

            public void onLvSuccess(BaseRes<UserAccount> baseRes) {
                VipCenterModel.this.accountData.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("vipCardList");
        HttpUtils.getInsatance().cancelTag("payment");
        HttpUtils.getInsatance().cancelTag("userAccount");
    }
}
